package com.dongbao.listeners;

import com.intellij.execution.ExecutionManager;
import com.intellij.execution.Executor;
import com.intellij.execution.ui.RunContentDescriptor;
import com.intellij.execution.ui.RunContentManager;
import com.intellij.execution.ui.RunContentWithExecutorListener;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;

public class Loader  implements  RunContentWithExecutorListener {

    private Project project;

    public void someMethod(Project project){
        project = project;
        project.getMessageBus().connect().subscribe(RunContentManager.TOPIC, this);

    }

    @Override
    public void contentSelected(RunContentDescriptor runContentDescriptor, @NotNull Executor executor) {
        System.out.println("【contentSelected】运行了~！");
    }

    @Override
    public void contentRemoved(RunContentDescriptor runContentDescriptor, @NotNull Executor executor) {
        System.out.println("【contentRemoved】运行了~！");

    }

}
